<@override name="styles">
<link rel="stylesheet" type="text/css" href="<@s.url '/resources/styles/issue/view.css'/>"/>
</@override>
<@override name="project">
${project.name}
</@override>
<@override name="main">
<h2>${info.type.pname} ${info.issue.pkey}</h2>

<div art="vcutter" filly="false">
    <div id="issue_inforamtions">
        <div id="meta">
            <h1>
                <a href="#" name="top" title="${info.issue.summary}">${info.issue.summary}</a>
            </h1>
            <@s.message 'issue.view.status'/><span class="box" id="issue_label"
                                                   style="background-color:${info.label.color};border-color:${info.label.color};color:#fff;"
                                                   title="${info.label.description}">${info.label.name}</span>
            <span><@s.message 'issue.view.priopity'/></span>
            <img id="issue_priopity" src="<@s.url '/resources/common/images/'/>${info.priopity.iconUrl}"/>
            <span id="pri">
				<span id="pri_name" title="${info.priopity.description}">${info.priopity.name}</span>
			</span>
            <@s.message 'issue.view.reporter.m1'/><span class="box">${info.issue.reporter}</span><@s.message 'issue.view.reporter.m2'/>
            <@s.message 'issue.view.assgin.msg'/><span class="box" id="assign_name">${info.issue.assigneeName}</span>
            &nbsp;
        </div>
        <p>
            <@s.message 'issue.view.created'/><span class="box"> ${info.issue.created?string("yyyy-MM-dd HH:mm:ss")}</span>
            <#if info.issue.updated??>
                <@s.message 'issue.view.updated'/><span class="box" id="update">${info.issue.updated?string("yyyy-MM-dd HH:mm:ss")}</span>
            </#if>
            <#if info.issue.last_comment_time??>
                <@s.message 'issue.view.last_comments'/><span class="box"
                                                              id="comments">${info.issue.last_comment_time?string("yyyy-MM-dd HH:mm:ss")}</span>
            <#else>
                <span id="comments_span" class="hidden">
				<@s.message 'issue.view.last_comments'/><span class="box" id="comments"></span>
				</span>
            </#if>
        </p>

        <div id="action_toolbar" art="toolbar">
            <div position="right">

                <#if info.issue.issuestatus ==1>
                    <button  text="<@s.message 'issue.operation.reopen'/>" icon="undo"
                             tooltip="<@s.message 'issue.visitor.view.toolbar.tip.reopen'/>"></button>
                </#if>
                <#if info.issue.issuestatus ==0 || info.issue.issuestatus ==2>
                    <button text="<@s.message 'issue.operation.close'/>" icon="closed"
                            tooltip="<@s.message 'issue.visitor.view.toolbar.tip.close'/>"></button>
                    <button text="<@s.message 'issue.view.prioperty.text'/>" icon="priority"
                            tooltip="<@s.message 'issue.visitor.view.toolbar.tip.priority'/>"></button>
                    <button text="<@s.message 'issue.operation.labels'/>" icon="label"
                            tooltip="<@s.message 'issue.visitor.view.toolbar.tip.labels'/>"></button>
                    <button text="<@s.message 'issue.operation.assign'/>" icon="assigned" id='assign_btn'
                            tooltip="<@s.message 'issue.visitor.view.toolbar.tip.assign'/>"></button>
                </#if>
                <#if info.issue.issuestatus ==0>
                    <button text="<@s.message 'issue.operation.fix'/>" icon="fix" id='fix_btn'
                            tooltip="<@s.message 'issue.visitor.view.toolbar.tip.fix'/>"></button>
                </#if>
                <button category="split"></button>
                <button text="<@s.message 'issue.operation.comment.toolbar'/>" icon="comment"
                        tooltip="<@s.message 'issue.visitor.view.toolbar.tip.comment'/>"></button>
            </div>
        </div>

        <div id="description" class="entry">
        ${info.issue.description}
        </div>
        <#if info.attachments??>
            <div id="attachment" class="entry">
                <@s.message 'issue.visitor.attachment.label'/>
                <#list info.attachments as attachment>
                    <p>
                        <a href="<@s.url '${attachment.url}'/>" title="<@s.message 'issue.visitor.attachment.download'/>" target="_blank">
                            &nbsp;&nbsp;&nbsp;&nbsp;${attachment.name}
                        </a>
                    </p>
                </#list>
            </div>
        </#if>
    </div>
    <div id="issue_comments" class="box">
        <h3><@s.message 'issue.view.comments'/></h3>

        <div id="issue_comment_grid"></div>
    </div>
    <div id="issue_comment_back">
        <div class="user"><a href="#" name="answerform"></a></div>
        <form id='form_answer' action="<@s.url '/issue/comment'/>" method="post">
            <input id="issue_comment_id" name="issue" value="${info.issue.id}" type="hidden">
            <textarea id='txt_answner' name='content' style='width:620px;height:160px;'></textarea>
            <br/>

            <button id="btn_submit" type="submit">
                <span><span> <@s.message 'issue.button.comment'/> </span></span>
            </button>
            <span id='form_msg' class="hidden"></span>
            <br/>
            <br/>
        </form>

        <div class="right"><a href="#top"><@s.message 'issue.view.top'/></a>&nbsp;|&nbsp;<a
                href="#wrapper"><@s.message 'issue.view.page.top'/></a></div>
    </div>
</div>

<div id="issue_labels" title="<@s.message 'issue.label.lay.title' />">
    <input type="hidden" id="label_select_val" value=""><br/>
    <ul id="choose_label" class="color-label-list filter-list small">
        <#list labels as label>
            <li title="${label.description}" class="js_choose_label" id="lable_${label.id}" color="${label.color}" name="${label.name}"
                value="${label.id}" onclick="issue_view.label_f_click('lable_${label.id}','${label.description}');">
                <a href="javascript:;" id="lable_${label.id}_link" class="filter-item color-label" value="${label.id}">
                    <span class="color" style="background-color: ${label.color}">&nbsp;</span>
                    <span class="name">${label.name}</span>
                </a>
            </li>
        </#list>
    </ul>
    <div class="rule"></div>
    <button class="left" id="choose_ok_label" onclick="issue_view.choose_ok();"><span><span><@s.message 'operation.confirm'/></span></span>
    </button>
    <button class="right" id="choose_cancel_label" onclick="issue_view.cancel();"><span><span><@s.message 'operation.cancel'/></span></span>
    </button>
</div>
<div art="layer" id="assign_div"></div>

<input type="hidden" id="label_desc_record" value="label_desc_record"/>
<input type="hidden" id="priopity_select_val" value="id"/>
<input type="hidden" id="icon_record" value="icon"/>
<input type="hidden" id="name_record" value="name"/>
<input type="hidden" id="desc_record" value="desc"/>
<input id="issue_id_priopity" type="hidden" value='${info.issue.id}'/>

<div id="priopity_change_div" title="<@s.message 'issue.priopity.lay.title' />">
    <ul id="choose_priopity" class="color-label-list filter-list small">
        <#list priopities as priopity>
            <li title="${priopity.description}" class="js_choose_label" id="priopity_${priopity.id}" name="${priopity.name}" value="${priopity.id}"
                onclick="issue_view.priopity_f_click('priopity_${priopity.id}','${priopity.iconUrl}','${priopity.name}','${priopity.description}');">

                <a href="javascript:;" id="priopity_${priopity.id}_link" class="filter-item color-label" value="${priopity.id}">
                    &nbsp;<img id="icon" src="<@s.url '/resources/common/images/'/>${priopity.iconUrl}"/>
                    <span class="name">${priopity.name}</span>
                </a>
            </li>
        </#list>
    </ul>
    <div class="rule"></div>
    <button id="choose_ok_priopity" onclick="issue_view.priopity2_choose_ok();"><span><span><@s.message 'operation.confirm'/></span></span></button>
    <button id="choose_close_priopity" class="float_right" onclick="issue_view.choose_priopity_close();">
        <span><span><@s.message 'operation.cancel'/></span></span></button>
</div>
<div id="issue_fix_comment_back" style="display: none;">
    <div style="padding: 3px;margin: 3px;">
        <form id='fix_form_answer'  method="post">
            <input id="fix_issue_comment_id" name="issue_ids" value="" type="hidden">
            <textarea id='fix_txt_answner' name='content' style='width:500px;height:260px;'></textarea>

            <br/>
            <span id='fix_form_msg' style='display:none;'></span>
            <div style="float: right;" width="400px" height="60px" background="black">
                <div style="float: left;"><button id="fix_btn_submit" type="button" onclick="issue_view.fix_comment_submit()">
                    <span><span> <@s.message 'issue.operation.fix'/> </span></span>
                </button>
                </div>

                <div style="float: right;">
                    <button id="fix_btn_cancel" type="button" onclick="issue_view.close_layer('issue_fix_comment_back')">
                        <span><span> <@s.message 'operation.cancel'/> </span></span>
                    </button>
                </div>
            </div>
        </form>
    </div>
</div>

<div id="issue_close_comment_back" style="display: none;">
    <div style="padding: 3px;margin: 3px;">
        <form id='close_form_answer' action="" method="post">
            <textarea id='close_txt_answner' name='content' style='width:500px;height:260px;'></textarea>

            <br/>
            <span id='close_form_msg' style='display:none;'></span>
            <div style="float: right;" width="400px" height="60px" background="black">
                <div style="float: left;"><button id="close_btn_submit" type="button" onclick="issue_view.close_comment_submit()">
                    <span><span> <@s.message 'issue.operation.close'/> </span></span>
                </button>
                </div>

                <div style="float: right;">
                    <button id="close_btn_cancel" type="button" onclick="issue_view.close_layer('issue_close_comment_back')">
                        <span><span> <@s.message 'operation.cancel'/> </span></span>
                    </button>
                </div>
            </div>
        </form>
    </div>
</div>

<input id="info_issue_issuestatus" type="hidden" value="${info.issue.issuestatus}" >
</@override>
<@override name="scripts">
<script type="text/javascript" src="<@s.url '/resources/common/ke/kindeditor-min.js'/>" charset="utf-8"></script>
<script type="text/javascript">
    var js_param = {
        upload_url             : '<@s.url '/action/upload'/>',
        view_issue_accounts_url: '<@s.url '/issue/view_assign/'/>',
        view_assign_submit     : '<@s.url '/issue/view_assign_submit'/>',
        comment_url            : '<@s.url "/issue/comment/"/>',
        comment_load_url       : '<@s.url "/issue/view/comments/"/>',
        close_comment_submit_url : '<@s.url '/issue/close_comment_submit'/>',
        priopity_change_url    : '<@s.url "/issue/priopity_change"/>',
        reopen_issue_url       : '<@s.url "/issue/reopen/"/>',
        <#--fix_issue_url               :'<@s.url "/issue/fix/"/>',-->
        fix_comment_submit_url  : '<@s.url "/issue/fix_comment_submit"/>',
        lable_change           : '<@s.url "/issue/label_change"/>',
        issue_id               :${info.issue.id},
        issue_pid              :${info.issue.pid}

    };
</script>

<script type="text/javascript" src="<@s.url '/resources/common/ke/kindeditor-min.js'/>" charset="utf-8"></script>
<script type="text/javascript" src="<@s.url '/resources/scripts/issue/view.js'/>"></script>
</@override>
<@extends name="/common/projectlayout1.1.ftl" current="issue" title='issue.operation.add' code="${project.code}"></@extends>